package com.sheeran.aichat.feign;

import feign.codec.Decoder;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.support.SpringDecoder;
import org.springframework.context.annotation.Bean;

/**
 * @author: sheeran
 * @create: 2025/02/10
 */
public class WrappedResponseExceptionDecodeConfig {

    @Bean
    public Decoder decoder(ObjectFactory<HttpMessageConverters> messageConverters) {
        return new WrappedResponseExceptionDecoder(new SpringDecoder(messageConverters));
    }
}
